package com.jeasonzhao.report.vml.base;


public class ArcText extends Arc
{
    public ArcText()
    {
        super();
    }

    public ArcText(Vector2D topleft,Vector2D size)
    {
        setTopLeft(topleft);
        setSize(size);
    }

    public ArcText(int top,int left,int width,int height)
    {
        setTopLeft(top,left);
        setSize(width,height);
    }

    protected boolean isNecessarily(String str)
    {
        if(null != str &&
           (str.equalsIgnoreCase("filled")))
        {
            return true;
        }
        return super.isNecessarily(str);
    }

    public String getTagName()
    {
        return "arc";
    }

    public void setText(String strText)
    {
        if(null == strText)
        {
            return;
        }
        Path p = (Path)this.getSubVmlElement(Path.class);
        if(p == null)
        {
            p = new Path();
            p.setIsTextPath(true);
            this.addSubVmlElement(p);
        }
        TextPath tp = (TextPath)this.getSubVmlElement(TextPath.class);
        if(null == tp)
        {
            tp = new TextPath();
            this.addSubVmlElement(tp);
        }
        tp.setFitpath(true);
        tp.setOn(true);
        tp.setText(strText);
    }

    public static void main(String str[])
        throws Exception
    {
        ArcText a = new ArcText(0,0,100,100);
        a.setStartAngle(0);
        a.setEndAngle(180);
        a.setText("1234567890");
        System.out.println(a.getScript());
    }
}
